<%@ Page Language="C#" %>
<script language="c#" runat="server">
        void Page_Load()
        {
            if (Request.Cookies["AnonymousID"] == null)
            {
                HttpCookie userCookie = new HttpCookie("AnonymousID");
                Guid userguid = System.Guid.NewGuid();
                userCookie.Value = "USERID:" + userguid.ToString() + "|BOOKID:" + Request.QueryString["bookid"].ToString();
                userCookie.Expires = DateTime.Now.AddYears(1);
                Response.Cookies.Add(userCookie);
            }
            else
            {
                HttpCookie userCookie = Request.Cookies["AnonymousID"];
                userCookie.Value +=  "|BOOKID:" + Request.QueryString["bookid"].ToString();
                userCookie.Expires = DateTime.Now.AddYears(1);
                Response.Cookies.Add(userCookie); 
            }
        }       
</script> 
              